import React from 'react';
import ReactDOM from 'react-dom/client';
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
import './index.css';
import App from './App';
import Home from './pages/Home';
import Appointment from './pages/Appointment';
import Consultation from './pages/Consultation';
import SymptomChecker from './pages/SymptomChecker';
import Plans from './pages/Plans';
import Profile from './pages/Profile';
import AIChat from './pages/AIChat';
import ProviderLayout from './pages/provider/ProviderLayout';
import ProviderDashboard from './pages/provider/Dashboard';
import ProviderAppointments from './pages/provider/Appointments';
import ProviderConsults from './pages/provider/Consults';
import ProviderPrescribe from './pages/provider/Prescribe';

const router = createBrowserRouter([
  {
    path: '/',
    element: <App />,
    children: [
      { index: true, element: <Home /> },
      { path: 'appointment', element: <Appointment /> },
      { path: 'consultation', element: <Consultation /> },
      { path: 'symptoms', element: <SymptomChecker /> },
      { path: 'plans', element: <Plans /> },
      { path: 'profile', element: <Profile /> },
      { path: 'ai', element: <AIChat /> },
      {
        path: 'provider',
        element: <ProviderLayout />,
        children: [
          { index: true, element: <ProviderDashboard /> },
          { path: 'appointments', element: <ProviderAppointments /> },
          { path: 'consults', element: <ProviderConsults /> },
          { path: 'prescribe', element: <ProviderPrescribe /> },
        ],
      },
    ],
  },
]);

ReactDOM.createRoot(document.getElementById('root')!).render(
  <React.StrictMode>
    <RouterProvider router={router} />
  </React.StrictMode>
);


